/*---------------------------------------------------------------------
 * File name: hal_system.h
 *
 * Copyright (c) <2020-2022>, <ChenLong>
 *
 * All rights reserved.
 *
 * Author: ChenLong
 * Email: worldlong@foxmail.com
 *--------------------------------------------------------------------*/
#pragma once
/*
*/
#include "system.h"
/*
*/
class HAL_System : public hal::System
{
public:
  HAL_System() {}
  
  void init();
  void close_all_periph();
  void reset();
};

/*
*/
inline void interrupt_disable()
{
  __asm("CPSID  i");
}
/*
*/
inline void interrupt_enable()
{
  __asm("CPSIE  i");
}
/*
*/
inline uint32_t enter_critical()
{
  __asm("MRS  r0, PRIMASK\n"
        "CPSID  i\n"
        "BX  lr");
  return 0;  //Will not reach here, just used to clear the compiling warning
}
/*
*/
inline void exit_critical(uint32_t sr)
{
  __asm("MSR  PRIMASK, r0\n"
        "BX  lr");
}
/*
*/
struct DMA_Info
{
  uint8_t id;
  
};


